﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ContasReceber.aspx.cs" Inherits="NewTierra.Pages.Financeiro.ContasReceber" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
    <link rel="shortcut icon" href="../../images/Icones/favicon.ico" type="image/x-icon" />

    <link href="../../Styles/jquery_notification.css" rel="stylesheet" />

    <link href="../../Styles/jquery-ui.css" rel="stylesheet" />    
    <script type="text/javascript" src="../../Scripts/jquery-1.11.0.js"></script>
    <script type="text/javascript" src="../../Scripts/jquery-ui-1.10.0.js"></script>


    <script type="text/javascript" src="../../Scripts/jquery_notification_v.1.js"></script>

    <link href="~/Styles/EstiloGeral.css" rel="stylesheet" type="text/css" />


</head>
<body>
    <style type="text/css">
        .ConsultaIncluir {
            height: auto;
            border: 1px solid #d9d9d9;
            background: #f9f9f9;
            float: left;
        }

        #tabs {
            height: 600px;
        }
    </style>

    <script>

        function jScript() {
            $("#tabs").tabs();

            $("#txtDataPagarFatura").datepicker();
            $("#txtDataDeposito").datepicker();
            
        }

        function CallServerCliente() {
            document.getElementById('<%= btnFiltroNomeCliente.ClientID %>').click();
        }

        function ShowIcon() {
            var e = document.getElementById("processing");
            e.style.visibility = (e.style.visibility == 'visible') ? 'hidden' : 'visible';
        }

        function CallServerConta() {
            document.getElementById('<%= btnFiltroConta.ClientID %>').click();
        }

    </script>
    <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>

        <script type="text/javascript">
            function showAutoCloseMessage(MsgsExc) {
                showNotification({
                    message: MsgsExc,
                    autoClose: true,
                    type: "success",
                    duration: 5
                });
            }


        </script>

        <div class="bgHeader">

            <div class="bgHeader_into">
                <asp:ImageButton ID="ImgVoltarMenu" OnClick="VoltarMenu" runat="server" ImageUrl="~/images/Icones/iconeMenu2.png" ToolTip="Menu" />
            </div>

            <div class="bgHeader_into" style="width: 250px;">

                <asp:Label ID="lblSupplierHeader" runat="server" Text="Contas a Receber" CssClass="titulo" />

            </div>

        </div>

        <div id="CadastroCusto">
            <div id="tabs">
                <ul>
                    <li><a href="#tabs-1">Invoices</a></li>
                    <li><a href="#tabs-2">Depositos</a></li>
                </ul>


                <div id="tabs-1">
                    <asp:UpdatePanel runat="server" ID="updTab1">
                        <ContentTemplate>
                            <script type="text/javascript" language="javascript">
                                Sys.Application.add_load(jScript);
                            </script>                           

                                <div class="ConsultaIncluir radius">
                                    <table style="float: left; width: 690px;">

                                        <tr>
                                            <td>
                                                <asp:Label ID="lblCliente" runat="server" Text="Clientes:" />
                                            </td>
                                            <td colspan="6">
                                                <asp:TextBox ID="txtCliente" runat="server" Width="425" />
                                                <img id="processing" alt="load" style="visibility: hidden" src="../../images/ajax-loader.gif" />

                                                <asp:Button ID="btnFiltroNomeCliente" Style="display: none" runat="server" Text="" OnClick="btnFiltroNomeCliente_Click" />
                                                <asp:AutoCompleteExtender
                                                    ServiceMethod="SearchClientes"
                                                    MinimumPrefixLength="1"
                                                    CompletionInterval="100"
                                                    EnableCaching="False"
                                                    TargetControlID="txtCliente"
                                                    OnClientPopulating="ShowIcon"
                                                    OnClientPopulated="ShowIcon"
                                                    ID="AutoCompleteExtenderQuoteNumber" runat="server"
                                                    OnClientItemSelected="CallServerCliente"
                                                    DelimiterCharacters=""
                                                    Enabled="True">
                                                </asp:AutoCompleteExtender>

                                            </td>
                                        </tr>
                                        <tr>

                                            <td>
                                                <asp:Label ID="lblValorPagarFatura" runat="server" Text="Valor:" />
                                            </td>
                                            <td>
                                                <asp:TextBox ID="txtValorPagarFatura" runat="server" />
                                            </td>


                                            <td>
                                                <asp:Label ID="lblCambioPagarFatura" runat="server" Text="Cambio:" />
                                            </td>
                                            <td>
                                                <asp:TextBox ID="txtCambioPagarFatura" runat="server" />
                                            </td>
                                        </tr>

                                        <tr>

                                            <td>
                                                <asp:Label ID="lblDataPagarFatura" runat="server" Text="Data:" />
                                            </td>
                                            <td>
                                                <asp:TextBox ID="txtDataPagarFatura" runat="server" />
                                            </td>


                                            <td>
                                                <asp:Label ID="lblContaPagarFatura" runat="server" Text="Conta:" />
                                            </td>
                                            <td>
                                                <asp:TextBox ID="txtContaPagarFatura" runat="server" Width="100" OnTextChanged="txtContaPagarFatura_TextChanged" />
                                                <img id="Img3" alt="load" style="visibility: hidden" src="../../images/ajax-loader.gif" />

                                                <asp:Button ID="btnFiltroConta" Style="display: none" runat="server" Text="" OnClick="btnFiltroConta_Click" />
                                                <asp:AutoCompleteExtender
                                                    ServiceMethod="SearchConta"
                                                    MinimumPrefixLength="1"
                                                    CompletionInterval="100"
                                                    EnableCaching="False"
                                                    TargetControlID="txtContaPagarFatura"
                                                    OnClientPopulating="ShowIcon"
                                                    OnClientPopulated="ShowIcon"
                                                    ID="AutoCompleteExtender7" runat="server"
                                                    OnClientItemSelected="CallServerConta"
                                                    DelimiterCharacters=""
                                                    Enabled="True">
                                                </asp:AutoCompleteExtender>
                                            </td>

                                        </tr>


                                        <tr>
                                            <td>
                                                <asp:Label ID="lblMoedaPagarFatura" runat="server" Text="Moeda:" />
                                            </td>
                                            <td>
                                                <asp:DropDownList ID="cmbMoedaPagarFatura" runat="server" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <asp:Label ID="lblObsPagarInvoice" runat="server" Text="Obs:" />
                                            </td>
                                            <td colspan="4">
                                                <asp:TextBox ID="txtObsPagarInvoice" runat="server" MaxLength="250" TextMode="MultiLine" Width="543px" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <asp:Button ID="btnPagarInvoice" runat="server" Text="Pagar" CssClass="btnGeralAzul" OnClick="btnPagarInvoice_Click" />
                                            </td>
                                        </tr>




                                    </table>
                                </div>
                                <div>
                                    <asp:GridView ID="gridInvoicesContasReceber" runat="server" CssClass="mGrid" AutoGenerateColumns="false" GridLines="None">
                                        <AlternatingRowStyle CssClass="alt" />
                                        <Columns>
                                            <asp:BoundField DataField="NumeroFile" HeaderText="File" ItemStyle-Width="300" />
                                            <asp:BoundField DataField="NomePassageiro" HeaderText="Nome Passageiro" ItemStyle-Width="300" />
                                            <asp:BoundField DataField="NumeroInvoice" HeaderText="Invoice" ItemStyle-Width="300" />
                                            <asp:BoundField DataField="TotalInvoice" HeaderText="Total" ItemStyle-Width="300" />

                                            <asp:TemplateField HeaderText="Pagar" ItemStyle-Width="50">
                                                <ItemTemplate>
                                                    <asp:CheckBox ID="chkGridPagarInvoiceContasReceber" runat="server" AutoPostBack="true" OnCheckedChanged="chkGridPagarInvoiceContasReceber_CheckedChanged" />
                                                </ItemTemplate>
                                            </asp:TemplateField>

                                        </Columns>
                                    </asp:GridView>
                                </div>
                        </ContentTemplate>
                    </asp:UpdatePanel>
                </div>




                <div id="tabs-2">
                    <asp:UpdatePanel runat="server" ID="UpdatePanel1">
                        <ContentTemplate>
                            <script type="text/javascript" language="javascript">
                                Sys.Application.add_load(jScript);
                            </script>     
                                <fieldset style="border-radius: 10px; height: 55px;">

                                <legend>
                                    <h3>Banco</h3>
                                </legend>
                                <div class="CadBox_grid">
                                    <table>
                                        <tr>
                                            <td>
                                                <asp:Label ID="lblValorDeposito" runat="server" Text="Valor:" />
                                            </td>
                                            <td>
                                                <asp:TextBox ID="txtValorDeposito" runat="server" CssClass="TextBoxsPequeno" />
                                            </td>

                                            <td>
                                                <asp:Label ID="lblCambioDeposito" runat="server" Text="Cambio:" />
                                            </td>
                                            <td>
                                                <asp:TextBox ID="txtCambioDeposito" runat="server" CssClass="TextBoxsPequeno" />
                                            </td>

                                            <td>
                                                <asp:Label ID="lblMoedaDeposito" runat="server" Text="Moeda:" />
                                            </td>
                                            <td>
                                                <asp:DropDownList ID="cmbMoedaDeposito" runat="server" />
                                            </td>

                                            <td>
                                                <asp:Label ID="lblDataDeposito" runat="server" Text="Data:" />
                                            </td>
                                            <td>
                                                <asp:TextBox ID="txtDataDeposito" runat="server" />
                                            </td>
                                            <td>
                                                <asp:Button ID="btnReceberDeposito" runat="server" Text="Incluir" CssClass="btnGeralAzul" OnClick="btnReceberDeposito_Click" />
                                            </td>
                                        </tr>
                                    </table>
                                </div>
                            </fieldset>
                            
                                                   
                        </ContentTemplate>                       

                    </asp:UpdatePanel>
                </div>
            </div>
        </div>



    </form>
</body>
</html>
